<?
/*--------------------------------------------------|
| 是梦的--文档总管[dreamxyp_explorer] 1.05v         |
| 主页：http://code.google.com/p/dreamxyp-explorer/				    |
| Q Q ：31996798				    |
| msn : xiayiping_xyp@hotmail.com  		    |
|---------------------------------------------------|

|---------------------------------------------------|
| Copyright (c) 2003-2004 是梦的[dreamxyp]86cpu.com |
|                                                   |
| 本程式是免费软体                                  |
| 任何人都可以使用，复制，传播，修改                |
|                                                   |
| 请不要删除以上信息！                              |
| 但你在修改完善后，可以请追加上你的信息.           |
|                                                   |
|                             是梦的2004.11.17 北京 |
|--------------------------------------------------*/

require('file_type_inc.php'); 
//便用目录
$dir=getMyPath('',$_REQUEST['dir']);
$file=$_REQUEST['file'];
if(empty($_REQUEST['mode'])){
	$mode=ShowType($file);
}else{
	$mode=$_REQUEST['mode'];
}


if($mode=='down'){
			//
			$downfile=MASTER_ROOTDIR.$dir."/".$file;
                if (!is_file($downfile))
					echo"你要下的文件不存在";
                $filename = basename($downfile);
                $filename_info = explode('.', $filename);
                $fileext = $filename_info[count($filename_info)-1];
                header('Content-type: application/x-'.$fileext);
                header('Content-Disposition: attachment; filename='.$filename);
                header('Content-Description: PHP3 Generated Data');
                readfile($downfile);
                exit;
}
$fileurl=MASTER_ROOTDIR.$dir."/".$file;
$WHurl=$dir."/".$file;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><? echo ShowTitle($mode)?></title>
<style>
<!--
.img_t{border:#F7F7F7 1px solid; background:#E5E5E5; word-break:break all; word-wrap:word-break}
.img_t02{background:#ffffff; border:#B2B2B2 1px solid}
.style3 {
	color: #FF0000;
	font-size: 12px;
}
.style2 {font-size: 12px}
.bb{font-size:9pt;background-color:#ffffff;border: 1px solid #E3E9F1;color:#000000}
-->
</style>
</head>
<?
if($mode=='htm'||$mode=='swf'){


echo "<FRAMESET border=0 frameBorder=0 frameSpacing=0 rows=100%,*>
<frame src='$fileurl'>
</FRAMESET><noframes></noframes>";
 
}else{
?>
<body topmargin="0">
<table width="98%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><b class="style2">当前路径</b> <b class="style3">WD:<? echo $WHurl ?></b></td>
  </tr>
</table>
<?
if($mode=='img'){
?>
<table  border="1" align="center" cellpadding="8" cellspacing="1" class="img_t">
  <tr class="img_t02">
    <td><img src="<? echo $fileurl?>" /></td>
  </tr>
</table>
<?
}elseif($mode=='mp'){
?>
<table  border="1" align="center" cellpadding="8" cellspacing="1" class="img_t">
  <tr class="img_t02">
    <td>
	<embed 
	src="<? echo $fileurl?>" 
	width=423 
	height=327 
	align="absmiddle" 
	type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 
	flename=mp>
	</embed></td>
  </tr>
</table>
<?
}elseif($mode=='rm'){
?>
<table  border="1" align="center" cellpadding="8" cellspacing="1" class="img_t">
  <tr class="img_t02">
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><object id="vid" name="mpplay" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="423"
height="300" align="middle">
  <param name="_ExtentX" value="11298">
  <param name="_ExtentY" value="7938">
  <param name="AUTOSTART" value="-1">
  <param name="SHUFFLE" value="0">
  <param name="PREFETCH" value="0">
  <param name="NOLABELS" value="-1">
  <param name="SRC" value="<? echo $fileurl?>">
  <param name="CONTROLS" value="Imagewindow">
  <param name="CONSOLE" value="clip1">
  <param name="LOOP" value="0">
  <param name="NUMLOOP" value="0">
  <param name="CENTER" value="0">
  <param name="MAINTAINASPECT" value="0">
  <param name="BACKGROUNDCOLOR" value="#000000">
</object>
</td>
  </tr><tr>
    <td><object id="vid2"  classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="423"
height="27" align="right">
        <param name="_ExtentX" value="11298">
        <param name="_ExtentY" value="794">
        <param name="AUTOSTART" value="-1">
        <param name="SHUFFLE" value="0">
        <param name="PREFETCH" value="0">
        <param name="NOLABELS" value="-1">
        <param name="SRC" value="<? echo $fileurl?>">
        <param name="CONTROLS" value="ControlPanel">
        <param name="CONSOLE" value="clip1">
        <param name="LOOP" value="0">
        <param name="NUMLOOP" value="0">
        <param name="CENTER" value="0">
        <param name="MAINTAINASPECT" value="0">
        <param name="BACKGROUNDCOLOR" value="#000000">
      </object></td>
  </tr>
</table>
</td>
  </tr>
</table>

<? }?>
<table width='98%' height="0" border='0' cellpadding='0' cellspacing='0' onMouseOver="this.bgColor='#eeeeee';"  onMouseOut="this.bgColor='#ffffff';" >
        <tr>
           <td  height="5"><a href="tree.php" target="_top">
             <input name="Submit" type="button" class="bb" value="返回目录" onclick="document.location.replace('tree_main.php?dir=<? echo $dir ?>');">
           </a></td>
		</tr>
</table>
</body>
<? }?>


</html>
<?
function ShowTitle($mode){
	switch ($mode) {
		case 'img':
			return '文档总管--图档预览';
        break;
        case 'swf':
			return '文档总管--Flash档预览';
        break;
        case 'mp':
			return '文档总管--影音文档预览';
        break;
		case 'rm':
			return '文档总管--RM影音文档预览';
        break;
		case 'htm':
			return '文档总管--HTML文档预览';
        break;
}
	####
	
}
//down
/*--------------------------------------------------|
| 是梦的--文档总管[dreamxyp_explorer] 1.05v         |
| 主页：http://code.google.com/p/dreamxyp-explorer/				    |
| Q Q ：31996798				    |
| msn : xiayiping_xyp@hotmail.com  		    |
|---------------------------------------------------|

|---------------------------------------------------|
| Copyright (c) 2003-2004 是梦的[dreamxyp]86cpu.com |
|                                                   |
| 本程式是免费软体                                  |
| 任何人都可以使用，复制，传播，修改                |
|                                                   |
| 请不要删除以上信息！                              |
| 但你在修改完善后，可以请追加上你的信息.           |
|                                                   |
|                             是梦的2004.11.17 北京 |
|--------------------------------------------------*/
?>